package compiler.IR;

import java.util.HashSet;
import java.util.LinkedList;

import compiler.PrettyPrinter;
import compiler.Exceptions.ClassErrorMethod;
import compiler.Exceptions.ClassNotFound;
import compiler.Exceptions.CodeGenException;
import compiler.Exceptions.MethodNotFound;
import compiler.Exceptions.TypeCheckerException;
import compiler.Exceptions.VariableNotFound;

public class MJMethodCallExpr extends MJExpression {

	MJIdentifier va;
	MJExpression ea;
	LinkedList<MJExpression> parList;

	public MJMethodCallExpr(MJIdentifier va, LinkedList<MJExpression> parList) {
		this.va = va;
		this.parList = parList;

	}

	public MJIdentifier getVa() {
		return va;
	}

	public MJExpression getEa() {
		return ea;
	}

	public LinkedList<MJExpression> getParList() {
		return parList;
	}

	public void prettyPrint(PrettyPrinter prepri) {
		this.va.prettyPrint();
		prepri.print("(");
		boolean first = true;
		if (!parList.isEmpty()) {
			for (MJExpression ea : this.parList) {
				if (!first) {
					prepri.print(", ");
				} else {
					first = false;
				}
				ea.prettyPrint(prepri);
			}
			prepri.print(")");
		}
	}

}